package cn.jbit.enumiminter;

/**
 * @author 张在成
 */
public class Person {

    private  String  name;

    private  Integer age;

    private  Gender sex;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (name.equals("张三")){
            this.name="张三";
        }else {
            this.name="李四";
        }
    }

    public Integer getAge() {
        return age;
    }


    public void setAge(Integer age) {
        this.age = age;
    }

    public Gender getSex() {
        return sex;
    }

    public void setSex(Gender sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }


    public static void main(String[] args) {
            Person person=new Person();
            person.setName("王麻子");
            System.out.println(person.getName());
            person.setSex(Gender.男);
            Gender sex=person.getSex();
            switch (sex){
                case 女:
                    System.out.println("我是女孩");
                    break;
                case 男:
                    System.out.println("我是男孩");
                    break;
            }


    }
}
